Vue.component('child',{
    data:function(){
        return{
            name:"张三"
        }
    },
    methods: {
        handleClick(){
            this.$emit('greet',this.name);
        }
    },
    template:'<button @click="handleClick">Hello</button>'
})
var vemit=new Vue({
    el:"#vem",
    methods:{
        sayHello(name){
            alert("Hello, "+name);
        }
    }
})